<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                template="/templates/ui.xhtml">

    <ui:define name="head">
        <style type="text/css">
            .col-label {
                width: 100px;
                text-align: right;
            }

            .col-input {
                width: 30px;
            }
        </style>
        <script type="text/javascript" language="javascript">
            document.onkeydown = function TabReplace() {
                if (event.keyCode == 13) {
                    if (event.srcElement.tagName != 'BUTTON')
                        event.keyCode = 9;
                }
            }

            function doPopupWindow(obj) {
                var tablename = obj.parentNode.parentNode.childNodes[0].innerHTML;
                popupwindow = window.open("deleteLogDetl.xhtml?action=delete&amp;tablename=" + tablename, "popupwindow", "height=300,width=800,left=300,top=200,toolbar=no,menubar=no,scrollbars=yes,location=no");
                popupwindow.focus;
            }
        </script>

    </ui:define>

    <ui:define name="content">
        <div style="margin:5px;">
            <h:form id="query">
                <p:growl id="msgs" showDetail="false"/>
                <p:panel header="数据库表数据量详情">
                    <br/>
                    <p:fieldset legend="数据库预警信息" toggleable="true">
                        <h:panelGrid columns="2" cellpadding="30">
                            <p:graphicImage value="/images/dep/warn1.jpg" style="width:70px;height:70px;"/>
                            <h:panelGrid columns="1" style="font-size: 13px;">
                                <p:dataList value="#{sysDbCountAction.warningList}"
                                            var="warning" itemType="disc">
                                    #{warning}
                                </p:dataList>
                            </h:panelGrid>
                        </h:panelGrid>
                    </p:fieldset>
                    <br/>
                    <p:fieldset legend="数据库日志表记录数" toggleable="true">
                        <br/>
                        <p:dataTable id="pdt" style="width:100%;"
                                     dynamic="true"
                                     value="#{sysDbCountAction.tableBeanList}" var="record"
                                     paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                     paginator="true" rows="5" paginatorPosition="bottom"
                                     rowsPerPageTemplate="100,50,30,10,5"
                                     emptyMessage="数据记录为空...">
                            <p:column headerText="数据库表名" style="text-align:left">
                                <h:outputText value="#{record.tblname}"/>
                            </p:column>
                            <p:column headerText="中文注释" style="text-align:left">
                                <h:outputText value="#{record.chName}"/>
                            </p:column>
                            <p:column headerText="记录数" style="text-align:right">
                                <h:outputText value="#{record.recordCount}"/>
                            </p:column>
                            <p:column headerText="是否超限" style="text-align:center">
                                <h:outputText value="#{record.huge.title}"/>
                            </p:column>
                            <p:column headerText="操作" style="text-align:center">
                                <p:commandLink value="删除" style="color:blue" update="popupwindow"
                                               onclick="doPopupWindow(this);"/>
                            </p:column>
                        </p:dataTable>

                    </p:fieldset>
                </p:panel>
            </h:form>
        </div>
    </ui:define>

</ui:composition>